<a href="<?php echo base_url('member/info');?>">基本资料</a>&nbsp;
<a href="<?php echo base_url('member/info/changemobile');?>">修改手机号码</a>&nbsp;
<a href="<?php echo base_url('member/info/changepassword');?>">修改密码</a>&nbsp;<br>
<form action="" method="post">

当前登录密码：<input type="password" placeholder="" name="oldpassword" id="oldpassword" ><br><br>
新密码      ：<input type="password" placeholder="" name="password" id="password"   ><br><br>
确认新密码  ：<input type="password" placeholder="" name="password2" id="password2"  ><br><br>

        <br><br>
<input type="buttom" value="保存" onclick="return setinfo();">
</form>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">

function setinfo(){
    var valData = {
      'oldpassword'  :  $('#oldpassword').val(),
      'password'     :  $('#password').val(),
      'type'		     :  'password'
    }
    $.ajax({
        type : 'POST',
        url  : '<?php echo base_url('member/info/setinfo');?>',
        data : valData,
        success:function(msg){
            var json = eval('('+msg+')');
            if(json.err > 0){
                alert(json.msg)
            }
            if(json.err == 0 ){
              <?php
              // 密码修改成功,清除用户有关session
              $_SESSION['member_id']     = '';
              $_SESSION['member_mobile'] = '';
              ?>
            	alert('密码修改成功,请重新用新密码登录!');
              location.href = '<?php echo base_url('signup/login');?>';
            }
        }
    });
}

</script>